import requests
import re
import os
r=requests.get("https://www.sanchuangedu.cn/")
r=r.content
r=r.decode("utf-8")
res=re.findall(r"url=|src=\"(?:.*(?:png|jpg|gif))",r,re.I)
dir_name=".\image"
if not os.path.exists(dir_name):
    os.mkdir(dir_name)
    for i in res:
        i=i.split("src=\"/")[1]
        # print(i)
        i1="https://www.sanchuangedu.cn/"+i
        p_name=i1.split('/')[-1]
        i2 = requests.get(i1)
        # with open("./image{0}".format(a)+".png","wb+") as w:
        with open(dir_name+'\\'+p_name,"wb+") as w:
            w.write(i2.content)

#匹配里面的每一个单词，引号部分作为一个单词输出
msg = "san chuang tong le, welcom ,'hello world', learn python"
res=re.findall("(?<=').*(?=')|[a-zA-Z]+\s?",msg)
print(res)




